import {defineConfig} from 'vite'
import vue from '@vitejs/plugin-vue'

import path from 'path'




export default defineConfig({
    plugins: [vue()],
    base: '/blog/',
    server: {
        port: 5173,
        proxy: {
            '/blogAPI': {
                // target: 'http://127.0.0.1:8028/blogAPI',
                target: 'https://zzjtpp.top/blogAPI',
                changeOrigin: true,
                rewrite: (path) => path.replace(/^\/blogAPI/, '')
            },
            '/ChatGPT': {
                // target: 'http://127.0.0.1:8028/blogAPI',
                target: 'https://zzjtpp.top/ChatGPT',
                changeOrigin: true,
                rewrite: (path) => path.replace(/^\/ChatGPT/, '')
            }
        }
    },
    resolve: {
        alias: {
            '@': path.resolve(path.resolve(process.cwd()), 'src'),
            '~': path.resolve(process.cwd())
        }
    },
    build: {
        outDir: 'blog'
    }
})
